import bot from "../model/bot/amesu";
import browser, { tempDir } from "../model/browser/browser";
import func from "../model/func";
import { MsgAction, Tpl_panel_talent } from "../shared/master/MsgAction";

export default function(data:MsgAction){
    let d = data.data as Tpl_panel_talent;
    func.roundNumbers(d);
    browser.render(tempDir.天赋模板, {
        a:(d.points.a * d.leve.num).toFixed(2),
        b:(d.points.b * d.leve.num).toFixed(2),
        c:(d.points.c * d.leve.num).toFixed(2),
        d:(d.points.d * d.leve.num).toFixed(2),
        name:`天赋·${d.name}`,
        needExp:func.BN(d.leve.max - d.leve.now),
        leve:d.leve,
        style_body:d.style_id,
        style_title:d.title_style
    }).then((png) => {
        bot.sendLocaImage(data.tolocation, png);
    });

    // browser.render(tempDir.血统模板, {
    //     a: d.points.a,
    //     b: d.points.b,
    //     c: d.points.c,
    //     d: d.points.d,
    //     name: `${d.type}·${func.numberToChinese(d.leve.num)}阶`,
    //     style_body: d.style_id,
    //     style_title: d.title_style,
    //     needExp: func.BN(d.leve.max - d.leve.now)
    // }).then((png) => {
    //     bot.sendLocaImage(data.tolocation, png);
    // });
}